{template 'common/header-base'}
{if !empty($_W['uniacid']) && !defined('IN_MESSAGE')}
<div id="page-container" class="sidebar-l sidebar-o side-scroll header-navbar-fixed gw-container gw-container">
{else}
<div id="page-container" class="sidebar-l sidebar-o side-scroll header-navbar-fixed side-overlay-o gw-container" style="padding-left:0px">
{/if}
   {if !empty($_W['uniacid']) && !defined('IN_MESSAGE')}
          <!-- Sidebar -->
    <nav id="sidebar">
                <!-- Sidebar Scroll Container -->
                <div id="sidebar-scroll" style="">
                    <!-- Sidebar Content -->
                    <div class="sidebar-content">
                        <!-- Side Header -->
                        <div class="side-header side-content bg-white-op" >
                            <button class="btn btn-link text-gray pull-right hidden-md hidden-lg" type="button" data-toggle="layout" data-action="sidebar_close">
                                <i class="fa fa-times"></i>
                            </button>

                            <a class="gw-logo"  href="./?refresh"{if !empty($_W['setting']['copyright']['blogo'])}style="background:url('{php echo tomedia($_W['setting']['copyright']['blogo']);}') no-repeat;"{/if}></a>
                        </div>
                        <!-- END Side Header -->

                        <!-- Side Content -->
                        <div class="side-content">
                            <ul class="nav-main">

                            <li class="nav-main-heading"><span class="sidebar-mini-hide">管理当前公众号</span></li>
                                <li>
                                    <a class="active" href="{url 'home/welcome/platform'}"><i class="fa fa-asterisk fa-spin"></i><span class="sidebar-mini-hide">{$_W['account']['name']}</span></a>
                                </li>
                            <li class="nav-main-heading"><span class="sidebar-mini-hide">快捷入口</span></li>
                                <li>
                                    <a href="{url 'account/display'}" ><i class="fa fa-comments"></i><span class="sidebar-mini-hide">公众号管理</span></a>
                                </li>
                                {if $_W['role'] == 'founder'}
                                <li>
                                    <a href="{url 'system/welcome'}" ><i class="fa fa-cogs"></i><span class="sidebar-mini-hide">系统管理</span></a>
                                </li>
                                {/if}

                           </ul>
                        </div>
                        <!-- END Side Content -->
                    </div>
                    <!-- Sidebar Content -->
                </div>
                <!-- END Sidebar Scroll Container -->
    </nav>
            <!-- END Sidebar -->

    <!-- Header -->
    <header id="header-navbar" class="content-mini content-mini-full">
        <!-- Header Navigation Right -->
        <ul class="nav-header pull-right">

        <li class="dropdown topbar-notice">
                    <a type="button"  data-toggle="dropdown" style="padding-left:15px">
                        <span class="badge badge-primary" ><i class="fa fa-bell"></i> <span id="notice-total">0</span> </span>
                    </a>
                    <div class="dropdown-menu animated bounceInDown" aria-labelledby="dLabel">
                        <div class="block notnew">
                            <div class="block-content">
                                <ul id="notice-container" ></ul>
                            </div>
                        </div>
                    </div>
                </li>
            <li>
                <div class="btn-group">
                    <button class="btn btn-default btn-image dropdown-toggle" data-toggle="dropdown" type="button">
                        <img src="{php echo tomedia('headimg_'.$account['acid'].'.jpg')}?time={php echo time()}" onerror="this.src='resource/images/gw-wx.gif'" />
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right animated bounceInDown">
                        <li class="dropdown-header">{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if})</li>
                        <li>
                            <a tabindex="-1" href="{url 'home/welcome/platform'}">
                                <i class="fontello-icon-comment-alt-1 pull-right"></i>
                                {$_W['account']['name']}
                            </a>
                        </li>

                        {if $_W['role'] != 'operator'}
                        <li>
                            <a tabindex="-1" href="{url 'account/post' array('uniacid' => $_W['uniacid'])}">
                                <i class="fontello-icon-edit pull-right"></i>编辑当前账号资料
                            </a>
                        </li>
                        {/if}
                        <li>
                            <a tabindex="-1" href="{url 'account/display'}">
                                <i class="fontello-icon-chat-1 pull-right"></i>管理其它公众号
                            </a>
                        </li>
                        <li class="xp">
                            <a tabindex="-1" href="{url 'utility/emulator'}">
                                <i class="fontello-icon-edit-2 pull-right"></i>模拟测试
                            </a>
                        </li>
                        <li class="divider"></li>

                        <li><a href="{url 'user/profile/profile'}"><i class="fontello-icon-vcard pull-right"></i> 我的账号</a></li>
                {if $_W['role'] == 'founder'}
                <li><a href="{url 'system/welcome'}"><i class="fontello-icon-cog-alt pull-right"></i> 系统选项</a></li>
                <li><a href="{url 'system/welcome'}"><i class="fontello-icon-spin3 pull-right"></i> 自动更新</a></li>
                <li><a href="{url 'system/updatecache'}"><i class="fontello-icon-loop-alt pull-right"></i> 更新缓存</a></li>
                <li class="divider"></li>
                {/if}
                <li><a href="{url 'user/logout'}"><i class="fontello-icon-logout-1 pull-right"></i> 退出系统</a></li>
                    </ul>
                </div>
            </li>

        </ul>
        <!-- END Header Navigation Right -->

        <!-- Header Navigation Left -->
        <ul class="nav-header pull-left">
            <li class="hidden-md hidden-lg"style="margin-right: 1px;">
                <!-- Layout API, functionality initialized in App() -> uiLayoutApi() -->
                <button class="btn btn-default" data-toggle="layout" data-action="sidebar_toggle" type="button">
                    <i class="fa fa-navicon"></i>
                </button>
            </li>
            <li class="hidden-xs hidden-sm">
                <!-- Layout API, functionality initialized in App() -> uiLayoutApi() -->
                <button class="btn btn-default" data-toggle="layout" data-action="sidebar_mini_toggle" type="button">
                    <i class="fa fa-ellipsis-v"></i>
                </button>
            </li>
        </ul>
        <!-- END Header Navigation Left -->
    </header>
 {elseif empty($_W['uniacid']) && !defined('IN_MESSAGE')}

<header id="header-navbar" class="content-mini content-mini-full" style="left:0px">
    <!-- Header Navigation Right -->
    <ul class="nav-header pull-right">
    	<li>
    	<div class="btn-group">
            <button class="btn btn-default btn-image dropdown-toggle" data-toggle="dropdown" type="button">
                <img {if file_exists(IA_ROOT . '/attachment/headimg_'.$account['acid'].'.jpg')} src="{$_W['attachurl_local']}headimg_{$account['acid']}.jpg?acid={$account['acid']}"{else}src="resource/images/gw-wx.gif"{/if} onerror="this.src='resource/images/gw-wx.gif'" />
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu dropdown-menu-right animated bounceInDow">

                <li>
                    <a tabindex="-1" href="{url 'account/display'}">
                        <i class="fontello-icon-chat-1 pull-right"></i>公众号管理
                    </a>
                </li>
                <li>
	                <a href="{url 'system/welcome'}">
						<i class="fontello-icon-cog-alt pull-right"></i>系统管理
					</a>
				</li>
        		<li><a href="{url 'user/logout'}"><i class="fontello-icon-logout-1 pull-right"></i> 退出系统</a>
        		</li>
            </ul>
         </div>
        </li>
    </ul>
    <!-- END Header Navigation Right -->

    <!-- Header Navigation Left -->
    <ul class="nav-header pull-left">
        <li>
            <a class="gw-logo"  href="./?refresh"{if !empty($_W['setting']['copyright']['blogo'])}style="background:url('{php echo tomedia($_W['setting']['copyright']['blogo']);}') no-repeat;"{/if}>

            </a>
        </li>
    </ul>
    <!-- END Header Navigation Left -->
 </header>
{/if}

<main id="main-container">

<div class="content content-boxed">
<div class="block">
<div class="block-content block-content-narrow bshadow">

        {if defined('IN_MESSAGE')}

            <div class="row text-center">
                <div class="col-xs-12 col-sm-12 col-lg-12">
                <div class="alert alert-{$label} alert-dismissable">

                    {if is_array($msg)}
                        <h3 class="font-w300 push-15">MYSQL 错误：</h3>
                        <p>{php echo cutstr($msg['sql'], 300, 1);}</p>
                        <p><b>{$msg['error'][0]} {$msg['error'][1]}：</b>{$msg['error'][2]}</p>
                    {else}
                    <h3 class="font-w300 push-15"><i class="fa fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i> {$msg}</h3>
                    {/if}
                    {if $redirect}
                    <p><a href="{$redirect}">如果你的浏览器没有自动跳转，请点击此链接</a></p>
                    <script type="text/javascript">
                        setTimeout(function () {
                            location.href = "{$redirect}";
                        }, 3000);
                    </script>
                    {else}
                        <p>[<a href="javascript:history.go(-1);">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh">首页</a>]</p>
                    {/if}
                </div>
            </div>
        </div>
        {/if}



        <script>
    var h = document.documentElement.clientHeight;
    $("#main-container").css('min-height',h-60);
     require(['bootstrap'],function($){
        $('[data-toggle="tooltip"]').hover(function(){
            $(this).tooltip('show');
        },function(){
            $(this).tooltip('hide');
        });
    });
</script>
